<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>药材数据导入</title>
    <link rel="stylesheet" href="/lib/layui-v2.6.3/css/layui.css">
    <script src="/lib/layui-v2.6.3/layui.js"></script>
</head>
<body>
<div class="layuimini-container">
    </br>
    <div class="layuimini-main" style="margin-left: 20px">
        <div>请选择药材导入excel文件</div>
        </br>
        <button type="button" class="layui-btn layui-btn-normal" id="ID-upload-demo-choose">选择文件</button>
        <button type="button" class="layui-btn" id="ID-upload-demo-action">开始导入</button>
    </div>
</div>
<script>
  layui.use(['upload', 'element', 'layer'],function(){
      var $ = layui.jquery
          , upload = layui.upload
          , element = layui.element
          , layer = layui.layer;
    // 渲染
    upload.render({
      elem: '#ID-upload-demo-choose',
      url: '/miaosample/loadFile', // 此处配置你自己的上传接口即可
      auto: false,
      accept:"file",
      exts:'xlsx|xls',
      before: function(obj) {
            layer.msg('文件上传中...', {
                icon: 16,
                shade: 0.01,
                time: 500
           })
      },
      bindAction: '#ID-upload-demo-action',
      done: function(res){
        layer.msg('导入成功');
        console.log(res)
      }
    });
  });
</script>
</body>
</html>